---
title: Updates
description: A library that allows programmatically controlling and responding to new updates made available to your app.
sourceCodeUrl: 'https://github.com/expo/expo/tree/sdk-49/packages/expo-updates'
packageName: 'expo-updates'
iconUrl: '/static/images/packages/expo-updates.png'
---

import { GithubIcon } from '@expo/styleguide-icons/custom/GithubIcon';

import APISection from '~/components/plugins/APISection';
import { APIInstallSection } from '~/components/plugins/InstallSection';
import PlatformsSection from '~/components/plugins/PlatformsSection';
import { BoxLink } from '~/ui/components/BoxLink';
import { ConfigReactNative, ConfigPluginExample } from '~/ui/components/ConfigSection';
import { YesIcon, NoIcon } from '~/ui/components/DocIcons';

The `expo-updates` library allows you to programmatically control and respond to new updates made available to your app.

<PlatformsSection android emulator ios simulator />

## Installation

<APIInstallSection hideBareInstructions />

If you're installing this in a [bare React Native app](/bare/overview/), you should also follow these [additional installation instructions](/bare/installing-updates/).

## Configuration in app.json/app.config.js

The plugin is configured with the Expo account's username automatically when EAS CLI is used.

<ConfigPluginExample>

```json app.json
{
  "expo": {
    "plugins": [
      [
        "expo-updates",
        {
          "username": "account-username"
        }
      ]
    ]
  }
}
```

</ConfigPluginExample>

<ConfigReactNative>

Learn how to configure the native projects in the [installation instructions in the `expo-updates` repository](https://github.com/expo/expo/tree/main/packages/expo-updates#installation-in-bare-react-native-projects).

</ConfigReactNative>

## Usage

Most of the methods and constants in this module can only be used or tested in release mode. In debug builds, the default behavior is to always load the latest JavaScript from a development server. It is possible to [build a debug version of your app with the same updates behavior as a release build](/eas-update/debug/#debugging-of-native-code-in-an-app). Such an app will not open the latest JavaScript from your development server &mdash; it will load published updates just as a release build does. This may be useful for debugging the behavior of your app when it is not connected to a development server.

**To test manual updates in the Expo Go app**, run [`eas update`](/eas-update/introduction) and then open the published version of your app with Expo Go.

**To test manual updates with standalone apps**, you can create a [**.apk**](/build-reference/apk) or a [simulator build](/build-reference/simulators), or make a release build locally with `npx expo run:android --variant release` and `npx expo run:ios --configuration Release` (you don't need to submit this build to the store to test).

### Check for updates manually

The `expo-updates` library exports a variety of functions to interact with updates once the app is already running. In some scenarios, you may want to check if updates are available or not. This can be done manually by using [`checkForUpdateAsync()`](#updatescheckforupdateasync) as shown in the example below:

```jsx App.js
import { View, Button } from 'react-native';
import * as Updates from 'expo-updates';

function App() {
  async function onFetchUpdateAsync() {
    try {
      const update = await Updates.checkForUpdateAsync();

      if (update.isAvailable) {
        await Updates.fetchUpdateAsync();
        await Updates.reloadAsync();
      }
    } catch (error) {
      // You can also add an alert() to see the error message in case of an error when fetching updates.
      alert(`Error fetching latest Expo update: ${error}`);
    }
  }

  return (
    <View>
      <Button title="Fetch update" onPress={onFetchUpdateAsync} />
    </View>
  );
}
```

### Use `expo-updates` with a custom server

Every custom updates server must implement the [Expo Updates protocol](/technical-specs/expo-updates-1/).

<BoxLink
  title="Custom Expo Updates Server"
  description="You can find an example implementation of a custom server and an app using that server in this GitHub repository."
  href="https://github.com/expo/custom-expo-updates-server"
  Icon={GithubIcon}
/>

### Configuration options

There are build-time configuration options that control the behavior of `expo-updates`.

On Android, these options are set as `meta-data` tags adjacent to the tags added during installation in the **AndroidManifest.xml** file. You can also define these options at runtime by passing a `Map` as the second parameter of `UpdatesController.overrideConfiguration()`, and the provided values will override any value specified in **AndroidManifest.xml**.

On iOS, these properties are set as keys in **Expo.plist** file. You can also set them at runtime by calling `[EXUpdatesAppController.sharedInstance setConfiguration:]` at any point before calling `start` or `startAndShowLaunchScreen`, and the values in this dictionary will override any values specified in **Expo.plist**.

| iOS plist/dictionary key                                      | Android Map key                                      | Android meta-data name                                                          | Default                                                          | Required?                                                                                                |
| ------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `EXUpdatesEnabled`                                            | `enabled`                                            | `expo.modules.updates.ENABLED`                                                  | `true`                                                           | <NoIcon />                                                                                               |
| `EXUpdatesURL`                                                | `updateUrl`                                          | `expo.modules.updates.EXPO_UPDATE_URL`                                          | (none)                                                           | <YesIcon />                                                                                              |
| `EXUpdatesRequestHeaders`                                     | `requestHeaders`                                     | `expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY`                | (none)                                                           | <NoIcon />                                                                                               |
| `EXUpdatesSDKVersion`                                         | `sdkVersion`                                         | `expo.modules.updates.EXPO_SDK_VERSION`                                         | (none)                                                           | (exactly one of `sdkVersion` or `runtimeVersion` is required, Required for apps hosted on Expo's server) |
| `EXUpdatesRuntimeVersion`                                     | `runtimeVersion`                                     | `expo.modules.updates.EXPO_RUNTIME_VERSION`                                     | (none)                                                           | (exactly one of `sdkVersion` or `runtimeVersion` is required)                                            |
| `EXUpdatesReleaseChannel`                                     | `releaseChannel`                                     | `expo.modules.updates.EXPO_RELEASE_CHANNEL`                                     | `default`                                                        | <NoIcon />                                                                                               |
| `EXUpdatesCheckOnLaunch`                                      | `checkOnLaunch`                                      | `expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH`                             | `ALWAYS` (`ALWAYS`, `NEVER`, `WIFI_ONLY`, `ERROR_RECOVERY_ONLY`) | <NoIcon />                                                                                               |
| `EXUpdatesLaunchWaitMs`                                       | `launchWaitMs`                                       | `expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS`                              | `0`                                                              | <NoIcon />                                                                                               |
| `EXUpdatesCodeSigningCertificate`                             | `codeSigningCertificate`                             | `expo.modules.updates.CODE_SIGNING_CERTIFICATE`                                 | (none)                                                           | <NoIcon />                                                                                               |
| `EXUpdatesCodeSigningMetadata`                                | `codeSigningMetadata`                                | `expo.modules.updates.CODE_SIGNING_METADATA`                                    | (none)                                                           | <NoIcon />                                                                                               |
| `EXUpdatesCodeSigningIncludeManifestResponseCertificateChain` | `codeSigningIncludeManifestResponseCertificateChain` | `expo.modules.updates.CODE_SIGNING_INCLUDE_MANIFEST_RESPONSE_CERTIFICATE_CHAIN` | false                                                            | <NoIcon />                                                                                               |
| `EXUpdatesConfigCodeSigningAllowUnsignedManifests`            | `codeSigningAllowUnsignedManifests`                  | `expo.modules.updates.CODE_SIGNING_ALLOW_UNSIGNED_MANIFESTS`                    | false                                                            | <NoIcon />                                                                                               |

For a detailed explanation, see the [`expo-updates`](https://github.com/expo/expo/blob/main/packages/expo-updates/README.md) repository.

## API

```js
import * as Updates from 'expo-updates';
```

<APISection packageName="expo-updates" apiName="Updates" />

## Error codes

| Code                    | Description                                                                                                                                                                                                                                                   |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ERR_UPDATES_DISABLED`  | A method call was attempted when the Updates module was disabled, or the application was running in development mode                                                                                                                                          |
| `ERR_UPDATES_RELOAD`    | An error occurred when trying to reload the application and it could not be reloaded. For bare workflow apps, double check the setup steps for this module to ensure it has been installed correctly and the proper native initialization methods are called. |
| `ERR_UPDATES_CHECK`     | An unexpected error occurred when trying to check for new updates. Check the error message for more information.                                                                                                                                              |
| `ERR_UPDATES_FETCH`     | An unexpected error occurred when trying to fetch a new update. Check the error message for more information.                                                                                                                                                 |
| `ERR_UPDATES_READ_LOGS` | An unexpected error occurred when trying to read log entries. Check the error message for more information.                                                                                                                                                   |
